UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ecx4aBSye7XXT3mUN2ORFHLHn30T/OhhiZk8ceOWSyc=' 
WHERE 
  key_id = '26a891ac42be81864c17231f0f7a61e327c0f603293af77a07b999e9f2aa6305' 
  AND (
    token = 'ecx4aBSye7XXT3mUN2ORFHLHn30T/OhhiZk8ceOWSyc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00086