UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iKi9IYQoaisFMg+sAEyrNprfdnkEeqGotMq+ddUX63I=' 
WHERE 
  key_id = '439ea20c12b10aafe2912fe4165d5a47e0eddd9915a2a6d0ec7f731b099dedac' 
  AND (
    token = 'iKi9IYQoaisFMg+sAEyrNprfdnkEeqGotMq+ddUX63I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019