UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's68L4b4JNLnShchwyND9ZOxasW9M8RokiXoMWs6ND6Y=' 
WHERE 
  key_id = 'e36295456536e65aeb1df84558ab5632d997015179c035f6ce6d19808010026d' 
  AND (
    token = 's68L4b4JNLnShchwyND9ZOxasW9M8RokiXoMWs6ND6Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028