UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zm0oTj9yXqk9/3qK8mCCC+Mx6ftym+glszMXFtD1NBI=' 
WHERE 
  key_id = '52b49dcca8aa1f557eb7f5076a50a121525097d9e9e061be7935f2dbf58d8fbe' 
  AND (
    token = 'zm0oTj9yXqk9/3qK8mCCC+Mx6ftym+glszMXFtD1NBI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027