UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hMMes8NzZLaZyhE7OTEczOJV2d8SwrYRXZ+gbq3lq/g=' 
WHERE 
  key_id = 'e9b3aee0389203260e36e7ee83fec9e8f0132afb51ec7bc8376fbed5db7c64b7' 
  AND (
    token = 'hMMes8NzZLaZyhE7OTEczOJV2d8SwrYRXZ+gbq3lq/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043