UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lwN/pgxqgMOh8O7K90ZMPiClGusfncynbLOocshsuBc='
WHERE
key_id = 'a344fa045c078b8a7a45bcb7b30c33d2b707d5d88fadbf7b38ae180237269e27'
AND (
token = 'lwN/pgxqgMOh8O7K90ZMPiClGusfncynbLOocshsuBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)