UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OFPe485r0yhXdUriJyZp8mXa9Y55BmQsZUX9rCKaI9A=' 
WHERE 
  key_id = '608f5deef2080d71a563220376656e898dccbb26ba0df9e439770780153ad5dd' 
  AND (
    token = 'OFPe485r0yhXdUriJyZp8mXa9Y55BmQsZUX9rCKaI9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027