UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K/PIxSZmz9HRfMirtqel9q0vDadYy9fOnwTK95Nqb98='
WHERE
key_id = '4ccbf7005a46c9734798c88a2f1ec4692557816b8a03b7dde689feee7499e303'
AND (
token = 'K/PIxSZmz9HRfMirtqel9q0vDadYy9fOnwTK95Nqb98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)