UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RhRiHMNhuTFPHugyMqMco9rKrEDH6r+JaZM7hCwTbpw=' 
WHERE 
  key_id = '609c1855c96cbdbb37e6ce352089a5db1c030dc9eadc339a593653257d7c291d' 
  AND (
    token = 'RhRiHMNhuTFPHugyMqMco9rKrEDH6r+JaZM7hCwTbpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027