UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g5lht29GLh8LiHBcX/ViefnWdgg9Su9+rFwRy4C3Hxc='
WHERE
key_id = '6d1d4250efdb2f5ee12f5cbc177c4f1668834a6d141c9be687ebdc969a581017'
AND (
token = 'g5lht29GLh8LiHBcX/ViefnWdgg9Su9+rFwRy4C3Hxc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)