UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZRt0+18BeFutIMZHJlnEtt2/mnXht9Cqj/R0TcfE4AY='
WHERE
key_id = 'da71741dfb7b25b06648b988ac7084f88315c3504c2dabd7bd2e1c11476d9df9'
AND (
token = 'ZRt0+18BeFutIMZHJlnEtt2/mnXht9Cqj/R0TcfE4AY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)