UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hcckf64inpc3O++RxMX8taFVyWvdy3PIdS75k2GaIDg='
WHERE
key_id = '55bb64e51df846aac41991bba1e7660cdb240e78c551d861dedeed421e38097d'
AND (
token = 'hcckf64inpc3O++RxMX8taFVyWvdy3PIdS75k2GaIDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)