UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mtr4qi6ei5VEB9e3sr2KitV5SQGSkk89hdq69Okqf+M='
WHERE
key_id = 'e09acbd1c530eff676e812931a978c9386dd0c86e5bdad7adca79aab112d2bc8'
AND (
token = 'Mtr4qi6ei5VEB9e3sr2KitV5SQGSkk89hdq69Okqf+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)