UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7LEdl/4vvqEwHpBrkbwQ/Pw6LBI07nf0P/cBUsCdxz4=' 
WHERE 
  key_id = '6a8e264d414fd566867c6b5158abd48f99c32d7489d15736168448ebb698f95a' 
  AND (
    token = '7LEdl/4vvqEwHpBrkbwQ/Pw6LBI07nf0P/cBUsCdxz4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00075