UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x5Xf7XDPqJfBE4Zk5FWvrE+lAd2yRkOsQO6/j4IwXAc='
WHERE
key_id = '0807b1b76c8f4e9bdf2d89709c18f26c1096205b5f5b4cf1f1d25cced757a8ba'
AND (
token = 'x5Xf7XDPqJfBE4Zk5FWvrE+lAd2yRkOsQO6/j4IwXAc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)