UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b8dPHJhNQzkePOmkgHKqNgEImVAL9/DGqnrb1R32z8c='
WHERE
key_id = '1f6b23c5351b0a27df1f5e163b0dff7730d36c7f42e3cf8574551a8ca19ebb49'
AND (
token = 'b8dPHJhNQzkePOmkgHKqNgEImVAL9/DGqnrb1R32z8c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)