UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3xD7jJGInIwCgyzgP3dOtf1Y8r0mlndGGoLKh7Erloc='
WHERE
key_id = '748fbc073516b76ab91535f5f9627be4db5e865d37d3c6ba777bdc27bf094ed0'
AND (
token = '3xD7jJGInIwCgyzgP3dOtf1Y8r0mlndGGoLKh7Erloc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)