UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+YvtsGTcA/ts3rFPRzk3S++kivGTxkFSD/vgAftNk9o='
WHERE
key_id = '9b6810f83716a65ba460ace9ecbd8d1dce742a3f506afb9123e7bf99a3928e43'
AND (
token = '+YvtsGTcA/ts3rFPRzk3S++kivGTxkFSD/vgAftNk9o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)