UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7HMxxvBaZsFlcnq3NUlbpTLq8O2QcQO6+kV0F+/829k='
WHERE
key_id = '0d891eafc64f1d9a225a3f8f92556887769736c4e528ec7e47132ff924e36869'
AND (
token = '7HMxxvBaZsFlcnq3NUlbpTLq8O2QcQO6+kV0F+/829k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)