UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TROvkew7gXrvOvBCpJOO9+VwMAZiuKVnl59q2PpQuKM=' 
WHERE 
  key_id = '340f8b31d2c193db1a2b4aadf9c0e40f0e38c49394d5b194f20eaef1de0aef6e' 
  AND (
    token = 'TROvkew7gXrvOvBCpJOO9+VwMAZiuKVnl59q2PpQuKM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034