UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gaNM/fdL+CUZc6wIC07jDOryWx9s/3Pc9krah6rQZE8='
WHERE
key_id = 'd96962383cd4a54921ee5f12607e32011b319a3f83e2daef5a05d0ee8a329a7c'
AND (
token = 'gaNM/fdL+CUZc6wIC07jDOryWx9s/3Pc9krah6rQZE8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)