UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+w5EE/8I9ggSZz1kkNcHAHDW+jn6FVkIrVJ/awl1/QQ=' 
WHERE 
  key_id = '1c78985d86b94c9516db8989239f11c205e53a363d68e4451d7cda57a031f2b2' 
  AND (
    token = '+w5EE/8I9ggSZz1kkNcHAHDW+jn6FVkIrVJ/awl1/QQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061