UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Owl5GWGHp7+UPHO9TumoB7FNhIGDOTZLldRicxIddPw='
WHERE
key_id = '44715752933112239b690a0f3d693b3e9e75d35aad6f3ffbe85a3260349d7afc'
AND (
token = 'Owl5GWGHp7+UPHO9TumoB7FNhIGDOTZLldRicxIddPw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)