UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yFvt8eYXWx90135/e4fR4U0p7Y4tVTU2X13Bg/ShvgE=' 
WHERE 
  key_id = '9a1186265b5d4bc618d8a44f92bc040bdd0807f14b07a399fa245edbaa10eac6' 
  AND (
    token = 'yFvt8eYXWx90135/e4fR4U0p7Y4tVTU2X13Bg/ShvgE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027