UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SthBxpyRMWd8DYm+qyXHrDt9k0z/rWWpf0heYRpBX2U='
WHERE
key_id = '888d265aa11d3b226b1e450a77fd62769586fc19712d1e6a9917ead5bd1e490c'
AND (
token = 'SthBxpyRMWd8DYm+qyXHrDt9k0z/rWWpf0heYRpBX2U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)