UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FU3puKxxultkS+G0kyJeongGbofpuY04qx1qffAZpQ0=' 
WHERE 
  key_id = 'aeb8c5f404117e35684042b053721e9c8762e9fad27c5180e1dce31a1dca4a06' 
  AND (
    token = 'FU3puKxxultkS+G0kyJeongGbofpuY04qx1qffAZpQ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031