UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QX3cOFR7lh5J8dijQdwAaESX3O/Va7RHF56aE2w/KEo=' 
WHERE 
  key_id = '74cfd6404c3fa67e1d1eaee2dc62966fa39e97741760962992f7d62eb665726d' 
  AND (
    token = 'QX3cOFR7lh5J8dijQdwAaESX3O/Va7RHF56aE2w/KEo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016