UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mceqbIJDvAKAoKV9ostrSYXZ7fUmXY7i7Gr9Q+tOXMc=' 
WHERE 
  key_id = '3862d81683cd98ab12fa090dd963645a419962cf5ed162f0a74c18b93b53ca0c' 
  AND (
    token = 'mceqbIJDvAKAoKV9ostrSYXZ7fUmXY7i7Gr9Q+tOXMc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043