UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3FfvloMtec09rilk++5GVTpdDLN52J2WZv7ZthPe430='
WHERE
key_id = '195088521a9ac00b0a501b84545f9c855318b83c50ddf5cad3fd4c7fdcd3641d'
AND (
token = '3FfvloMtec09rilk++5GVTpdDLN52J2WZv7ZthPe430='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)