UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '65WKB4iWGOavtxf7KBZClmaS6LMlUzmpZ4FqPe/tDX8=' 
WHERE 
  key_id = '73f05abf87faa3c5bd320c67abe55d331262e9375a17c15a85c9f53ef84c837c' 
  AND (
    token = '65WKB4iWGOavtxf7KBZClmaS6LMlUzmpZ4FqPe/tDX8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016