UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FmYNQVNDIlx6OqmtysDwBS2HYrDZyVwtylMED4nrbgc='
WHERE
key_id = '00d4ed633465578888660b181d90c0449b93fdc8caad04c390a6e89248d3edc6'
AND (
token = 'FmYNQVNDIlx6OqmtysDwBS2HYrDZyVwtylMED4nrbgc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)