UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7vskt2xQYSEucjFF8vFRAmMJubtSLg4+6wbkuqhYIpA=' 
WHERE 
  key_id = '9b2d183d17bc0366fd2ef1e3f156616bd36811e6cb25d73939e4d605f5b31ef1' 
  AND (
    token = '7vskt2xQYSEucjFF8vFRAmMJubtSLg4+6wbkuqhYIpA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049