UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DGGZ05G08QdZmgeQAA1a3vULXxvDhm9dC4ZehX8+7Oc=' 
WHERE 
  key_id = 'ab3057b5ac5c4285efc086ed611e459edbf3f0746192f51f549eabf1aa471e38' 
  AND (
    token = 'DGGZ05G08QdZmgeQAA1a3vULXxvDhm9dC4ZehX8+7Oc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022