UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sSYNEkT6XbCypPJJO1Ts5zKy5rtcRwdP3Ui0VwYwr3w='
WHERE
key_id = 'f367c9ec67fb5d1fe4147d35c2dea6dc2fd4257521a3728dde0c6e106a29698f'
AND (
token = 'sSYNEkT6XbCypPJJO1Ts5zKy5rtcRwdP3Ui0VwYwr3w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)