UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xAuk8mLo6YMC7oc9+8cqmDPhg2Z8xzGGeME9yAJDoXw='
WHERE
key_id = '119479425474d04bd8c47c53248e15721e4bd3ec9a50f127f382ebc75fd92198'
AND (
token = 'xAuk8mLo6YMC7oc9+8cqmDPhg2Z8xzGGeME9yAJDoXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)