UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PkS/2O94bWxQZJqlNNkswz3qrqcQ941q1OohFQ/yldA='
WHERE
key_id = 'c522fa03e17acd56309d64ca1641708c1dee36b7a741f5d173ef380c7adc7d35'
AND (
token = 'PkS/2O94bWxQZJqlNNkswz3qrqcQ941q1OohFQ/yldA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)