UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QF8q4SRqmjKQj6/OxUzqttLTOd14oIxzjIrW/PBLrKI=' 
WHERE 
  key_id = 'c0093d9712dd666e263e5dc8d03d2c6a6a3648ede34f294defbdfc9cbf7a2665' 
  AND (
    token = 'QF8q4SRqmjKQj6/OxUzqttLTOd14oIxzjIrW/PBLrKI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028