UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y8s3hrDxOvccjAgKPSpkSY2d/StXS7RN8FLMxmBFnNg='
WHERE
key_id = 'd6a93de43481d792255942f2139852ee63deb14405c706dc217ab1eaf467c62e'
AND (
token = 'Y8s3hrDxOvccjAgKPSpkSY2d/StXS7RN8FLMxmBFnNg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)