UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L9pcNwJNzBuWQ6Uvv1Tr0A13PQifAabiCsuWU14ixZA=' 
WHERE 
  key_id = '581fb5152ec7bb2cafddb98ab6d94cb2325e308ec7fbdda0d5cb431cc4b3b2b2' 
  AND (
    token = 'L9pcNwJNzBuWQ6Uvv1Tr0A13PQifAabiCsuWU14ixZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027