UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4LibxKYdZc/MdjEaDIWwdOpQ4nrlrNLhW+V4iqnm50w=' 
WHERE 
  key_id = '9cb2a959010dd594e761f358434a09fa1c781c6894d4eefcbbbf33d4f6290831' 
  AND (
    token = '4LibxKYdZc/MdjEaDIWwdOpQ4nrlrNLhW+V4iqnm50w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035