UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'urqSoYSZDSD5b4JmAbjebb/b1XxSJlwykKk8MCNFIZk='
WHERE
key_id = '4ed4048f184a0f7eb551aba1277950f8ea38045d3ca576efaf86798d959a8b12'
AND (
token = 'urqSoYSZDSD5b4JmAbjebb/b1XxSJlwykKk8MCNFIZk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)