UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7CXrp7bhHJ4YZj8i8NNplRYIJkZA2lSBJKANkbK5zLc='
WHERE
key_id = '931b15edb898ca1d91c0a49538a3728e5fca4ed283a1a7d58a46067031a6d56d'
AND (
token = '7CXrp7bhHJ4YZj8i8NNplRYIJkZA2lSBJKANkbK5zLc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)