UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0GZScKre/1oacYA+/3O5PzS1Ol7ycO40JITh5O22w8o='
WHERE
key_id = 'e08f7e9cfa82c128452c611ed72903a293d06fd77de1a5b9cbf9bbafed88e4af'
AND (
token = '0GZScKre/1oacYA+/3O5PzS1Ol7ycO40JITh5O22w8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)