UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5iGixz19LZv3PgqF0LLHNBGK3knH0qhhuL424aXkDx4='
WHERE
key_id = 'fa8332f09a7824cc1eeae7efd2a0a04fc1932bc11ec018238d24f5b5534a9380'
AND (
token = '5iGixz19LZv3PgqF0LLHNBGK3knH0qhhuL424aXkDx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)