UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PIgzRJK5uiuLKKyFXZm2fB2vrDQO3XIw04Fq/D+u7Co='
WHERE
key_id = '8081c8656a39483fff6d340b4611e6f0f9433f69a99012e904d5714c1d85278a'
AND (
token = 'PIgzRJK5uiuLKKyFXZm2fB2vrDQO3XIw04Fq/D+u7Co='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)