UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xJqPdL1AiPq0T0X+vs9UC99mSVHM89Jd3Jo0cWk1zpo='
WHERE
key_id = 'dac8ca74cadc837568d746f09cbdc6e00d6c029ba08b5b91c9a5889fe61c3838'
AND (
token = 'xJqPdL1AiPq0T0X+vs9UC99mSVHM89Jd3Jo0cWk1zpo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)