UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fmm9zb75NnP3l6vCKs1Nsu8J6X5rm3IwP5RUN/pIvnE=' 
WHERE 
  key_id = '5c401e00b64ddaedf2d11a1999e80c91b18a1ac5b5a06a4f7f6fb720fea38df8' 
  AND (
    token = 'fmm9zb75NnP3l6vCKs1Nsu8J6X5rm3IwP5RUN/pIvnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036