UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E1jgIKGx/ZZSxOoEsCRGYFttd/KwJhH/Qj4/pOYFtmc='
WHERE
key_id = 'b61e33580c494831709acaef3e51d85989f298e461e8db79d2ac43195ec66b48'
AND (
token = 'E1jgIKGx/ZZSxOoEsCRGYFttd/KwJhH/Qj4/pOYFtmc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)