UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1bQPa3zMKWo4u6D1rcoA1DHAaS15VzZGfKWCDdEPEFw=' 
WHERE 
  key_id = '35c9115e51a78475df15d87ee4054bfce7b3c268ce0202157058bdc3f5a4b916' 
  AND (
    token = '1bQPa3zMKWo4u6D1rcoA1DHAaS15VzZGfKWCDdEPEFw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038