UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4H60GMl1Ee62Qssg7c/ulYLscHcv0VTye6DnSh6USFY='
WHERE
key_id = '8d38c7961012edc8bf777f9c9e6af13c9542935ff99437cb7c5b47ac8cc1e99b'
AND (
token = '4H60GMl1Ee62Qssg7c/ulYLscHcv0VTye6DnSh6USFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)