UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4To5N51WUjfMfdNUnZsX495oV++NCWXzmkbydYiua0E='
WHERE
key_id = '64a4ef690723e90438ea703a7520eb353dac2c45ccc6e6d713977d38d3f63ff2'
AND (
token = '4To5N51WUjfMfdNUnZsX495oV++NCWXzmkbydYiua0E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)