UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kygudGE4GqlD212eTAbvdP61XsUYeF/t7OqcTMWLWVU='
WHERE
key_id = '6f510438af96663a00cc7c1e10ec43ece3e3629b9abd29b22c8daea40c8f8363'
AND (
token = 'kygudGE4GqlD212eTAbvdP61XsUYeF/t7OqcTMWLWVU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)