UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RifXJaQQc5v620E4S3QyIIkNC5vuSWtRDI6OBldu/cw='
WHERE
key_id = '8091c5b8651d02858d3babeca79ba79dbb85aef44c8b1ced5472450c4f0d35cc'
AND (
token = 'RifXJaQQc5v620E4S3QyIIkNC5vuSWtRDI6OBldu/cw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)