UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 300,
token = 'TDrXmmZceUEKGcMMSWcc4aFDDnQBDuY9GBTSkFIg9FY='
WHERE
key_id = '6e5ad91cbc22b341e5c8685b0b99f0f243e4c1318a5e7f4c3a3a79a98459d159'
AND (
token = 'TDrXmmZceUEKGcMMSWcc4aFDDnQBDuY9GBTSkFIg9FY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)