UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FsedFvegEPmEqIi22iN/NdV5BceE7bzfxuczlgLMpRs=' 
WHERE 
  key_id = 'c7ae24a6b99738e12d91bee38cbdee6e7dd6b00bd143912bdc16821c5891b3ca' 
  AND (
    token = 'FsedFvegEPmEqIi22iN/NdV5BceE7bzfxuczlgLMpRs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030