UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0GwGfum+i3FB1RBiu46YyUjmpHX8145MpoDrnaH/vxA='
WHERE
key_id = 'fe634746aa7bcd5db4ca800a09bee02243c68cc472d1c6ff242b3e60643ffc83'
AND (
token = '0GwGfum+i3FB1RBiu46YyUjmpHX8145MpoDrnaH/vxA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)