UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '84VhQ8SfkXk8qkLQN4sG8/41zcRH0j8PRYg9HRLXkFk='
WHERE
key_id = '0540872ed38e14fe5308c1fcdf99095a3c4b2eacdf7bffdeac4f7ab10af68f64'
AND (
token = '84VhQ8SfkXk8qkLQN4sG8/41zcRH0j8PRYg9HRLXkFk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)