UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GX3zGr6cmlOJbLriKMB4R/WNdBJpXqt8TGFGE4bjaCc=' 
WHERE 
  key_id = '525f742c878dbeba03943d88c1a20b0b0e0d3a816ec90d5872839ee64808ce76' 
  AND (
    token = 'GX3zGr6cmlOJbLriKMB4R/WNdBJpXqt8TGFGE4bjaCc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051