UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WZdN47dJZ+/355xKfX47jlpKlqwIA8I0QEvqJrLcPQA='
WHERE
key_id = 'ba4bcbba360924edad749052af4abd131d26aa02834afbd15d43c0918176a0d6'
AND (
token = 'WZdN47dJZ+/355xKfX47jlpKlqwIA8I0QEvqJrLcPQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)