UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xBjV2x+3++mpZVYh06nCiWHFU6KLpDigwPmq/aSOPd8='
WHERE
key_id = 'd5ae28ba42b7a6e0e640145445d75f85a250e449e00bdc16b76a8a5aa068a712'
AND (
token = 'xBjV2x+3++mpZVYh06nCiWHFU6KLpDigwPmq/aSOPd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)