UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ThEQGmZqBrnc4qg3Po8omNdUWJFpP0UQaO1iVNj4EtY=' 
WHERE 
  key_id = '5d1426abbd7252e1b66cdb43954fc96c1ae4c6edaee2ce0d112b22cc71f07af2' 
  AND (
    token = 'ThEQGmZqBrnc4qg3Po8omNdUWJFpP0UQaO1iVNj4EtY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043