UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Pfhow3kXJfzFZ9tk0CjB1xy+b8kOMn/FmXDfkbQbeE=' 
WHERE 
  key_id = 'e18f33227a1f043b05347efb0e11bacdcdff0aac40db272da3f8b402a89d5c55' 
  AND (
    token = '5Pfhow3kXJfzFZ9tk0CjB1xy+b8kOMn/FmXDfkbQbeE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00087