UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WH7UzZsos9f+LTaDrrqB4AYjsQeq2t2hfGFIIGHFbPQ=' 
WHERE 
  key_id = '54a75466259c4a545ef13526791177184b44df4a95c2fc7891f14854eab24cf8' 
  AND (
    token = 'WH7UzZsos9f+LTaDrrqB4AYjsQeq2t2hfGFIIGHFbPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017